<template>
    <!-- // 5G驻留比小区详单(天)表 -->
    <index-card :indexCardTitle="indexCardTitle">
        <el-table :data="tableData" v-loading="loading">
            <el-table-column prop="cgi" label="CGI" min-width="200" />
            <el-table-column prop="phyPointName" label="物理点名称" min-width="200" />
            <el-table-column prop="phyPointId" label="物理点编号" min-width="200" />
            <el-table-column prop="cityName" label="地市名称" min-width="200" />
            <el-table-column prop="areaName" label="区域名称" min-width="200" />
            <el-table-column prop="userType" label="用户类型" min-width="200" />
            <el-table-column prop="gnodebCode" label="基站编号" min-width="200" />
            <el-table-column prop="gnodebName" label="基站名称" min-width="200" />
            <el-table-column prop="networkType" label="网络制式" min-width="200" />
            <el-table-column prop="cellName" label="NRCELL名称" min-width="200" />
            <el-table-column prop="areaType" label="区域" min-width="200" />
            <el-table-column prop="nodebStayRateTime" label="关联基站时长驻留比(%)" min-width="200" />
            <el-table-column prop="equUeNbrSa" label="等效终端数(SA)" min-width="200" />
            <el-table-column prop="nrLteCommonFlag" label="是否共站5G" min-width="200" />
            <el-table-column prop="grid500StayRateTime" label="GRID_500_STAY_RATE_TIME" min-width="200" />
            <el-table-column prop="grid500StayRateFlux" label="关联500米栅格流量驻留比(%)" min-width="200" />
            <el-table-column prop="saFlux" label="SA流量（MB）" min-width="200" />
            <el-table-column prop="nsaFlux" label="NSA流量（MB）" min-width="200" />
            <el-table-column prop="lteFlux" label="4G流量（MB）" min-width="200" />
            <el-table-column prop="saNetserviceTime" label="SA_网络业务时长(s)" min-width="200" />
            <el-table-column prop="nsaNetserviceTime" label="NSA_网络业务时长(s)" min-width="200" />
            <el-table-column prop="lteNetserviceTime" label="4g_网络业务时长(s)" min-width="200" />
            <el-table-column prop="normalUserNumber" label="用户数" min-width="200" />
            <el-table-column prop="stayUserNumber" label="常驻用户数" min-width="200" />
            <el-table-column prop="mrRsrpTotal" label="MR样本数" min-width="200" />
            <el-table-column prop="mrRsrpRate110" label="MR覆盖率（大于-110）" min-width="200" />
            <el-table-column prop="equUeNbrTotal" label="等效终端数(全量)" min-width="200" />
            <el-table-column prop="nodebStayRateFlux" label="关联基站流量驻留比(%)" min-width="200" />
        </el-table>
    </index-card>
</template>

<script setup>
import { ref } from "vue";
import { apiCommon, formatDateNormal } from "@/utils/index.js";
import * as qualityApi from "@/api/biz/networkQuality";
import mittBus from "@/utils/mittBus"; // mitt事件总线

mittBus.on("get5GIndexItemData", (params) => {
    getData(params)
});

const props = defineProps({
    indexCardTitle: {
        type: String,
        default: '',
    },
    rowsData: {
        type: Object,
        default: () => { },
    },
});

const tableData = ref([]);
let loading = ref(false);

const getData = async (params) => {
    // console.log('params', params)

    loading.value = true;
    tableData.value = await apiCommon(qualityApi.getNrResidencyDailyList, params);
    tableData.value = tableData.value.data;
    loading.value = false;
}

getData(props.rowsData);
</script>